var quiz = 
		[
	          {
	            	question:"name",
	            	answers:["J", "S", "M"]
	            },
	           {
	            	question:"age",
	            	answers:["Young", "Old", ]
	            },
	       {
	        	question: "country",
	        	answers:["UK", "Ukraine", "Spain"]
	        },
	        {
	        	question:"food",
	        	answers:["Cheese", "Soup", "Juice"]
	        }
	        ]; 
var askQuest;
var curIndex=0;
function main(){
	showQuest();
	showAns ();
}
function showQuest(){
	var curQuest=quiz[curIndex];
	
	 askQuest = document.querySelector ("#ask");
	 askQuest.innerText =  "Choose your " + curQuest.question;
}
function showAns (){
	var curAns =quiz[curIndex];
	var chooseAns = document.querySelectorAll ("span.radio");
	for (i=0; i<chooseAns.length; i++){
		chooseAns[i].innerText = curAns.answers[i];
	}
	
	
}

function next(){
	if (curIndex<quiz.length-1){
	curIndex++; //position is icreasing in every click
	showQuest();
	showAns ();
	}
	else curIndex =-1;
}
	


 
/**
 * 
 */